

const ERROR_SUCCESS = 0;
const ERROR_INVALID_URL = 1001;
const ERROR_DBNOT_CONNECTED = 1002;
const ERROR_DUPLICATE_KEY = 1003;
const ERROR_UNKNONW = 1004;
const ERROR_INVALID_ID = 1005;


const PAGE_LIMIT = 10

function GetTime() {
    let date = new Date()
    let Y = date.getFullYear() + '-';
    let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
    let D = date.getDate() + ' ';
    let h = date.getHours();
    let m = date.getMinutes();
    let s = date.getSeconds();
    if (D < 10) {
        D = '0' + D
    }
    if (h < 10) {
        console.log(1);
        h = '0' + h
    }
    if (m < 10) {
        m = '0' + m
    }
    if (s < 10) {
        s = '0' + s
    }
    return Y + M + D + h + ':' + m + ':' + s
}



module.exports = {
    ERROR_SUCCESS,
    ERROR_INVALID_URL,
    ERROR_DBNOT_CONNECTED,
    ERROR_DUPLICATE_KEY,
    ERROR_UNKNONW,
    ERROR_INVALID_ID,
    GetTime,
    PAGE_LIMIT,
}